package kxfang.com.common.utils;

import android.content.Context;
import android.os.Bundle;

import com.alibaba.android.arouter.facade.callback.NavigationCallback;
import com.alibaba.android.arouter.launcher.ARouter;

/**
 * Created by WL
 * on 2020/8/21
 * Class Content 路由工具
 */
public class RouterUtils {

    public static void navigate(String path){
        ARouter.getInstance()
                .build(path)
                .navigation();
    }

    public static void navigate(String path, Bundle bundle, Context context){
        ARouter.getInstance()
                .build(path)
                .with(bundle)
                .navigation(context);
    }
    public static void navigate(String path ,String key,String msg, Context context){
        ARouter.getInstance()
                .build(path)
                .withString(key,msg)
                .navigation(context);
    }

    public static void navigate(String path,Context context,int flags){
        ARouter.getInstance()
                .build(path)
                .addFlags(flags)
                .navigation(context);
    }



    public static void navigate(String path, Context context, NavigationCallback callback){
        ARouter.getInstance()
                .build(path)
                .navigation(context,callback);
    }

}
